home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 1999 January / maximum-cd-1999-01.iso / Benchmarks / 12 Step / MusicMatch Jukebox / mmsetup.EXE / data1.cab / Help_Files / WebHelp.cab / hhapplet / ContentsTree.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-03-27  |  1.9 KB  |  58 lines

  1. package hhapplet;
  2.  
  3. import java.applet.Applet;
  4. import java.awt.Image;
  5. import java.net.MalformedURLException;
  6. import treeview.ImageSet;
  7. import treeview.SiblingChildTree;
  8. import treeview.TreeViewNode;
  9.  
  10. public class ContentsTree extends TreeViewNode {
  11.    private String local;
  12.    private String url;
  13.    private String frame_name;
  14.    // $FF: renamed from: a java.applet.Applet
  15.    private Applet field_0;
  16.    private Image[] images;
  17.    private boolean use_folder_images;
  18.    private boolean new_topic;
  19.  
  20.    public ContentsTree(Applet var1, Image[] var2, String var3, String var4, String var5, String var6, boolean var7, boolean var8) {
  21.       super(var3, new ImageSet(var2));
  22.       this.field_0 = var1;
  23.       this.images = var2;
  24.       this.local = var4;
  25.       this.url = var5;
  26.       this.frame_name = var6;
  27.       this.use_folder_images = var7;
  28.       this.new_topic = var8;
  29.       ((TreeViewNode)this).setCollapsedState(true);
  30.    }
  31.  
  32.    public Image getCurrentImage() {
  33.       return ((TreeViewNode)this).getImages().getImage(this.imageIndex());
  34.    }
  35.  
  36.    private int imageIndex() {
  37.       return ((SiblingChildTree)this).numberOfChildren() == 0 ? 8 + (this.use_folder_images ? 2 : 0) + (this.new_topic ? 1 : 0) : (!((TreeViewNode)this).getCollapsedState() ? 1 : 0) + (this.new_topic ? 2 : 0) + (this.use_folder_images ? 4 : 0);
  38.    }
  39.  
  40.    public void doAction() {
  41.       if (this.local != null || this.url != null) {
  42.          if (this.local.charAt(0) == 'W' && this.local.startsWith("WebHelp:")) {
  43.             String var1 = this.local.substring(8);
  44.             ((WebHelp)this.field_0).Command(var1, "");
  45.          } else {
  46.             try {
  47.                if (this.frame_name != null) {
  48.                   this.field_0.getAppletContext().showDocument(URLFileHandler.makeURL(this.field_0.getDocumentBase(), this.local, this.url), this.frame_name);
  49.                } else {
  50.                   this.field_0.getAppletContext().showDocument(URLFileHandler.makeURL(this.field_0.getDocumentBase(), this.local, this.url), "_self");
  51.                }
  52.             } catch (MalformedURLException var2) {
  53.             }
  54.          }
  55.       }
  56.    }
  57. }
  58.